package java052;
import java.util.*;

public class Main052{
	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		int x=0;
		String str;
		Set<String> strsetree=new TreeSet<String>();
		for(int i=0;;i++){
			str=in.next();
			if(str.equals("!!!!!")) break;
			else strsetree.add(str);
		}
		System.out.println(strsetree.size());
		for(String s:strsetree){
			x=x+1;
			System.out.println(s);
			if(x==10) break;
		}
	}

}
